package com.yq.design.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @ClassName InfoCollege
 * @Description TODO
 * @Author yaoqiang
 * @Date 2021/8/24 16:25
 * @Version 1.0
 */
public class InfoCollege implements College {
    List<Department> departments;

    public InfoCollege() {
        departments=new ArrayList<Department>();
        addDepartment("xinxi1","xinxi1");
        addDepartment("xinxi2","xinxi2");
    }

    @Override
    public String getName() {
        return"info";
    }

    @Override
    public Iterator createIterator() {
        return null;
    }

    @Override
    public void addDepartment(String name, String desc) {
        Department department=new Department(name,desc);
        departments.add(department);
    }
}
